package com.example.shiwu.util;

import java.io.Serializable;

public abstract class BaseModel implements Serializable {

    public long id;


    public long getId() {
        return id;
    }
    public void setId(long id) {
        this.id = id;
    }


    /**数据正确性校验
     * @param data
     * @return
     */
    public static boolean isCorrect(BaseModel data) {
        return data != null && data.isCorrect();
    }

    /**数据正确性校验
     * @return
     */
    protected abstract boolean isCorrect();//public导致JSON.toJSONString会添加correct字段

}

